home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Translation Manager / Sample Code / Inside Mac Example (Pascal) / SamplePascalExtension.r < prev   
Encoding:
Text File  |  1998-06-05  |  2.0 KB  |  84 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SampleFileTranslationExt.r
  3.  
  4.     Contains:    Sample resources for writing a File Translation Extension.
  5.  
  6.     Copyright:    © 1991-1993 by Apple Computer, Inc., all rights reserved.
  7. */
  8.  
  9.  
  10.  
  11. #include "Types.r"
  12. #include "TranslationExtensions.h"
  13. #include "FileTypesAndCreators.h"
  14.  
  15. Include $$Shell("C3POObjects")"IM Example.rsrc";        // get 'xlat' code
  16.  
  17.  
  18. #define kSignature                 'ashe'    /* set this to creator signature of extension */
  19. #define kComponentFileType        'thng'    /* 'thng' => ComponentMgr component file */
  20.  
  21.  
  22. // Define the 'thng' resource to bind other resources together
  23. resource 'thng' (128, locked) {
  24.     'xlat',                                /* all Translation Extensions have type = 'xlat' */
  25.     0,                                    /* sub type unused */
  26.     kSignature,                            /* must be unique across all translation extensions  */
  27.     kSupportsFileTranslation,            /* add in kSupportsScapTranslation if scrap routines are implemented */
  28.     0,                                    /* mask is ignored and should be 0 */
  29.     'xlat',128,
  30.     'STR ',128,
  31.     'STR ',129,
  32.     'ICON',128
  33. };
  34.  
  35.  
  36. // Strings
  37. resource 'STR ' (128, purgeable) {
  38.     "Generic"
  39. };
  40.  
  41. resource 'STR ' (129, purgeable) {
  42.     "This is a sample Generic translation extension"
  43. };
  44.  
  45. // An icon
  46. resource 'ICON' (128, purgeable) {
  47.     $"7FFF FFF0 8000 0008 8000 0008 8000 0008"
  48.     $"8000 0008 8000 0008 8000 0008 8000 0008"
  49.     $"A000 0008 D000 000A 9000 000D 1000 0009"
  50.     $"1000 0001 1000 0001 1000 0001 1000 0001"
  51.     $"1000 0001 1000 0001 1000 0001 1000 0001"
  52.     $"1000 0009 9000 000D D000 000A A000 0008"
  53.     $"8000 0008 8000 0008 8000 0008 8000 0008"
  54.     $"8000 0008 8000 0008 8000 0008 7FFF FFF0",
  55. };
  56.  
  57. // Kind strings for documents supported
  58. resource 'kind' (128, purgeable) {
  59.     'dsny',
  60.     0,   // verUS
  61.     {
  62.         ftApplicationName,        "SleepyWrite",
  63.         'slpy',                    "SleepyWrite document",
  64.     }
  65. };
  66.  
  67. resource 'kind' (129, purgeable) {
  68.     'mcky',
  69.     0,   // verUS
  70.     {
  71.         ftApplicationName,        "HappyWrite",
  72.         'hapy',                    "HappyWrite document",
  73.     }
  74. };
  75.  
  76. resource 'kind' (130, purgeable) {
  77.     'ttxt',
  78.     0,   // verUS
  79.     {
  80.         ftApplicationName,        "TeachText",
  81.         'ttro',                    "TeachText document",
  82.     }
  83. };
  84.